home *** CD-ROM | disk | FTP | other *** search
- # Jedi Knight Cog Script
- #
- # POW_SHIELDS.COG
- #
- # POWERUP Script - Shields
- #
- # [YB & CYW]
- #
- # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
-
-
- symbols
-
- thing powerup local
- thing player local
- int bin=60 local
- sound pickupsnd=helthpu1.wav local
- sound respawnsnd=Activate01.wav local
- flex amount local
-
- message touched
- message taken
- message respawn
-
- end
-
- # ========================================================================================
-
- code
-
- touched:
- player = GetSourceRef();
- amount = GetInv(player, bin);
-
- if (amount < GetInvMax(player, bin))
- {
- TakeItem(GetSenderRef(), -1);
- call taken;
- }
-
- Return;
-
- # ........................................................................................
-
- taken:
- player = GetSourceRef();
- powerup = GetSenderRef();
-
- // Print("Shield Recharge");
- jkPrintUNIString(player, bin);
-
- // Do effects.
- PlaySoundLocal(pickupsnd, 1, 0, 0);
- AddDynamicTint(player, 0.0, 0.0, 0.2);
-
- // Increment powerup amount.
- ChangeInv(player, bin, 20.0);
-
- Return;
-
- # ........................................................................................
-
- respawn:
- PlaySoundThingLocal(respawnsnd, GetSenderRef(), 0.6, 5.0, 10.0, 0);
-
- Return;
-
- end
-
-
-